/**
 * File: MaqFileInfoStartupController.java
 * Created by: mhaimel
 * Created on: 30 Sep 2009
 * CVS:  $Id: MaqFileInfoStartupController.java,v 1.1 2009/10/09 14:54:33 mhaimel Exp $
 */
package uk.ac.ebi.curtain.controller.general;

import java.io.File;
import java.io.Serializable;
import java.util.List;

import uk.ac.ebi.curtain.controller.SingleSubmitController;
import uk.ac.ebi.curtain.utils.data.FileType;
import uk.ac.ebi.curtain.utils.data.MetaData;
import uk.ac.ebi.curtain.utils.data.impl.GenericDataHolder;
import uk.ac.ebi.curtain.utils.file.FileInfo;

/**
 * @author mhaimel
 *
 */
public class MaqFileInfoStartupController extends SingleSubmitController<Serializable, Serializable> {

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void singleSubmit(List<Serializable> inputList) {
		List<FileInfo> files = getContext().getArguments().getFiles(FileType.getMapTypes());
		for(FileInfo fi : files){
			Integer cat = getContext().getArguments().getCategory(fi);
			submit(new GenericDataHolder<File>(new MetaData(cat, fi.getFileType(), fi.getReadType()), fi.getFile()));
		}
	}
}
